<?php

class UdpPush {
	static  function send($ip, $port ,$data){
		$client = new swoole_client(SWOOLE_SOCK_UDP, SWOOLE_SOCK_SYNC);
		$client->connect($ip, $port);
		$client->send($data);	
	}
}

$serv = new swoole_server("127.0.0.1", 15555, SWOOLE_PROCESS, SWOOLE_SOCK_UDP); 
$serv->set([
    'worker_num' => 4,
    'daemonize' => 1,
    'max_request' => 10000
]);
//监听数据接收事件
$serv->on('Packet', function ($serv, $data, $clientInfo) {
    UdpPush::send('10.62.232.160', 6001, $data);
});

//启动服务器
$serv->start();